<template>
    <div>
        <save-cl-dic ref="saveModel"></save-cl-dic>
        <a-card style="margin-bottom: 12px;">
            <div slot="cover" style="padding: 15px;">
                <div style="font-size: 20px;line-height: 28px;font-weight: 500;color: rgba(0,0,0,.85);margin-bottom: 16px;">
                    车辆类型字典管理
                </div>
                <div style="font-size: 14px;color: rgba(0, 0, 0, 0.65);">
                    简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介简介
                </div>
            </div>
        </a-card>
        <a-row :gutter="12">
            <a-col :xs="24" :sm="12" :md="12" :xl="12" style="height: 430px;margin-bottom: 12px;">
                <a-card style="height: auto;">
                    <div slot="cover" style="width: 100%">
                        <div style="padding: 15px;height: 60px;width: 100%">
                            <span style="font-size: 18px;font-weight: 600">车辆车长</span>
                            <a-button
                                    @click="delModel"
                                    style="margin-left: 15px;margin-right: 15px;background-color: red;color: white;border-color: red"
                                    type="primary"
                                    icon="delete">删除
                            </a-button>
                            <a-button style="margin-right: 15px;" type="primary" @click="showAddDicModal">AddDic</a-button>
                            <a-button type="primary" @click="showMdfDicModal">MdfDic</a-button>
                        </div>
                        <clcc-table :AllClccData="ClDicData.clccList" style="height: auto;width: 100%"></clcc-table>
                    </div>
                </a-card>
            </a-col>
            <a-col :xs="24" :sm="12" :md="12" :xl="12" style="height: 430px;margin-bottom: 12px;">
                <a-card style="height: auto;">
                    <div slot="cover" style="width: 100%">
                        <div style="padding: 15px;height: 60px;width: 100%">
                            <span style="font-size: 18px;font-weight: 600">车辆车牌颜色</span>
                            <a-button
                                    @click="delModel"
                                    style="margin-left: 15px;margin-right: 15px;background-color: red;color: white;border-color: red"
                                    type="primary"
                                    icon="delete">删除
                            </a-button>
                            <a-button style="margin-right: 15px;" type="primary" @click="showAddDicModal">AddDic</a-button>
                            <a-button type="primary" @click="showMdfDicModal">MdfDic</a-button>
                        </div>
                        <clcpys-table :AllClcpysData="ClDicData.clcpysList" style="height: auto;width: 100%"></clcpys-table>
                    </div>
                </a-card>
            </a-col>
            <a-col :xs="24" :sm="12" :md="12" :xl="12" style="height: 430px;margin-bottom: 12px;">
                <a-card style="height: auto;">
                    <div slot="cover" style="width: 100%">
                        <div style="padding: 15px;height: 60px;width: 100%">
                            <span style="font-size: 18px;font-weight: 600">车辆类型</span>
                            <a-button
                                    @click="delModel"
                                    style="margin-left: 15px;margin-right: 15px;background-color: red;color: white;border-color: red"
                                    type="primary"
                                    icon="delete">删除
                            </a-button>
                            <a-button style="margin-right: 15px;" type="primary" @click="showAddDicModal">AddDic</a-button>
                            <a-button type="primary" @click="showMdfDicModal">MdfDic</a-button>
                        </div>
                        <cllx-table :AllCllxData="ClDicData.cllxList" style="height: auto;width: 100%"></cllx-table>
                    </div>
                </a-card>
            </a-col>
            <a-col :xs="24" :sm="12" :md="12" :xl="12" style="height: 430px;margin-bottom: 12px;">
                <a-card style="height: auto;">
                    <div slot="cover" style="width: 100%">
                        <div style="padding: 15px;height: 60px;width: 100%">
                            <span style="font-size: 18px;font-weight: 600">车辆品牌</span>
                            <a-button
                                    @click="delModel"
                                    style="margin-left: 15px;margin-right: 15px;background-color: red;color: white;border-color: red"
                                    type="primary"
                                    icon="delete">删除
                            </a-button>
                            <a-button style="margin-right: 15px;" type="primary" @click="showAddDicModal">AddDic</a-button>
                            <a-button type="primary" @click="showMdfDicModal">MdfDic</a-button>
                        </div>
                        <clpp-table :AllClppData="ClDicData.clppList" style="height: auto;width: 100%"></clpp-table>
                    </div>
                </a-card>
            </a-col>
            <a-col :xs="24" :sm="12" :md="12" :xl="12" style="height: 430px;margin-bottom: 12px;">
                <a-card style="height: auto;">
                    <div slot="cover" style="width: 100%">
                        <div style="padding: 15px;height: 60px;width: 100%">
                            <span style="font-size: 18px;font-weight: 600">
                                车辆载重
                            </span>
                            <a-button
                                    @click="delModel"
                                    style="margin-left: 15px;margin-right: 15px;background-color: red;color: white;border-color: red"
                                    type="primary"
                                    icon="delete">删除
                            </a-button>
                            <a-button style="margin-right: 15px;" type="primary" @click="showAddDicModal">AddDic</a-button>
                            <a-button type="primary" @click="showMdfDicModal">MdfDic</a-button>
                        </div>
                        <clzz-table :AllClzzData="ClDicData.clzzList" style="height: auto;width: 100%"></clzz-table>
                    </div>
                </a-card>
            </a-col>
        </a-row>
        <a-modal title="delModel" v-model="delModule" @ok="delOk">
            是否确认删除
        </a-modal>
    </div>
</template>

<script>
    import {deleteAction, getAction} from '@/api/manage'

    import ARow from "ant-design-vue/es/grid/Row";
    import ACol from "ant-design-vue/es/grid/Col";

    import SaveClDic from "@/views/my/dic_manage/caozuo/SaveClDic"

    import ClccTable from "@/views/my/dic_manage/table/ClDic/ClccTable"
    import ClcpysTable from "@/views/my/dic_manage/table/ClDic/ClcpysTable"
    import CllxTable from "@/views/my/dic_manage/table/ClDic/CllxTable"
    import ClppTable from "@/views/my/dic_manage/table/ClDic/ClppTable"
    import ClzzTable from "@/views/my/dic_manage/table/ClDic/ClzzTable"

    export default {
        name: "DicManage",
        components: {ACol, ARow, SaveClDic, ClccTable, ClcpysTable, CllxTable, ClppTable, ClzzTable},
        mixins: [],
        data() {
            return {
                delModule: false,
                AddClDicModal: false,
                ClDicData: "",
                HwDicData: "",
                QzDicData: "",
                UserDicData: "",
                url: {
                    //车辆分类的增删改查
                    getClDicInfo: "/my/cl_dic/getClDicInfo",
                    delClDicInfo: "/my/cl_dic/delClDicInfo",
                    //货物分类的增删改查
                    getHwDicInfo: "/my/hw_dic/getHwDicInfo",
                    delHwDicInfo: "/my/hw_dic/delHwDicInfo",
                    //求助分类的增删改查
                    getQzDicInfo: "/my/qz_dic/getQzDicInfo",
                    delQzDicInfo: "/my/qz_dic/delQzDicInfo",
                    //用户分类的增删改查
                    getUserDicInfo: "/my/user_dic/getUserDicInfo",
                    delUserDicInfo: "/my/user_dic/delUserDicInfo",
                },
            }
        },
        created() {
            this.loadData();
        },
        methods: {
            loadData() {
                getAction(this.url.getClDicInfo).then((res) => {
                    console.log("ClDicData",res.result);
                    if (res.success) {
                        this.ClDicData = res.result;
                        for (var i = 0; i < this.ClDicData.clccList.length; i++) {
                            this.ClDicData.clccList[i].key = i + 1
                        }
                        for (var k = 0; k < this.ClDicData.clcpysList.length; k++) {
                            this.ClDicData.clcpysList[k].key = k + 1
                        }
                        for (var j = 0; j < this.ClDicData.cllxList.length; j++) {
                            this.ClDicData.cllxList[j].key = j + 1
                        }
                        for (var q = 0; q < this.ClDicData.clppList.length; q++) {
                            this.ClDicData.clppList[q].key = q + 1
                        }
                        for (var w = 0; w < this.ClDicData.clzzList.length; w++) {
                            this.ClDicData.clzzList[w].key = w + 1
                        }
                    }
                    if (res.code === 510) {
                        this.$message.warning(res.message)
                    }
                });
                getAction(this.url.getHwDicInfo).then((res) => {
                    console.log("HwDicData",res.result);
                    if (res.success) {
                        this.HwDicData = res.result;
                        for (var i = 0; i < this.HwDicData.hwlxList.length; i++) {
                            this.HwDicData.hwlxList[i].key = i + 1
                        }
                        for (var j = 0; j < this.HwDicData.hwyclxList.length; j++) {
                            this.HwDicData.hwyclxList[j].key = j + 1
                        }
                        for (var w = 0; w < this.HwDicData.hwyslxList.length; w++) {
                            this.HwDicData.hwyslxList[w].key = w + 1
                        }
                    }
                    if (res.code === 510) {
                        this.$message.warning(res.message)
                    }
                });
                getAction(this.url.getQzDicInfo).then((res) => {
                    console.log("QzDicData",res.result);
                    if (res.success) {
                        this.QzDicData = res.result;
                        for (var i = 0; i < this.QzDicData.qzflList.length; i++) {
                            this.QzDicData.qzflList[i].key = i + 1
                        }
                        for (var k = 0; k < this.QzDicData.qzlxList.length; k++) {
                            this.QzDicData.qzlxList[k].key = k + 1
                        }
                    }
                    if (res.code === 510) {
                        this.$message.warning(res.message)
                    }
                });
                getAction(this.url.getUserDicInfo).then((res) => {
                    console.log("UserDicData",res.result);
                    if (res.success) {
                        this.UserDicData = res.result;
                        for (var i = 0; i < this.UserDicData.userSfList.length; i++) {
                            this.UserDicData.userSfList[i].key = i + 1
                        }
                    }
                    if (res.code === 510) {
                        this.$message.warning(res.message)
                    }
                })
            },
            showMdfDicModal(thisAddModel) {
                this.$refs.saveModel.showMdfDicModal(thisAddModel)
            },
            showAddDicModal(thisAddModel) {
                this.$refs.saveModel.showAddDicModal(thisAddModel)
            },
            openDelModule() {
            },
            handleshowAddClDicModalOk(e) {
                console.log(e);
                this.AddClDicModal = false;
            },


            delModel() {
                this.delModule = true
            },
            delOk() {
                this.delModule = false
            }
        },
        props: {},
        watch: {}
    }
</script>

<style scoped>

</style>